import  re
s = '1234556789'
new_s = re.sub('5', '替换词', s)

print(new_s)